1. Field of the Invention
The present invention relates to an image forming apparatus, a method for controlling the image forming apparatus, and a storage medium storing a program.
2. Description of the Related Art
A conventional image forming apparatus is provided with a manual bypass tray for feeding various sizes and types of paper. Upon a user placing paper in the manual bypass tray, a paper detection sensor of the manual bypass tray detects the paper, and a setting/registration screen for manually inserted paper is displayed on a UI screen in order to have the user designate the size and type of the paper. This setting/registration screen for manually inserted paper is displayed when a state where there is no paper in the manual bypass tray changes into a state where paper exists therein. The user can print the paper fed from the manual bypass tray by setting the type and size of the paper placed in the manual bypass tray, via the setting/registration screen. If the manual bypass tray has an automatic paper size detection function, upon the user placing paper in the manual bypass tray, a standard size that is closest to the detected paper size is estimated, and the estimated standard size can be displayed by default on the setting/registration screen for manually inserted paper. In this case, the user can complete registration of the manually inserted paper only by placing the paper in the manual bypass tray and setting the paper type via the setting/registration screen.
Meanwhile, a conventional image forming apparatus has a power-saving function of stopping electric power supply to hardware such as a printer engine, a scanner engine, and a display unit in an operation unit and causing the apparatus to transition to a power-saving mode, if an operation request is not given from the user for a certain time period or longer. In this power-saving mode, various sensors and the like that provide factors in returning to a standby mode continue to be energized, and the apparatus transitions to the standby mode upon an event serving as a factor in returning from the power-saving mode being detected. Events serving as the returning factors include pressing a return button for giving an instruction to return from a sleep state (power-savings mode), as well as detection of paper in the manual bypass tray, opening and closing of a platen, reception of network packets, detection of opening of a front door, and the like. Interrupt signals from sensors for detecting these events serving as the returning factors are input to a CPU in a main control unit, and occurrence of the events serving as the returning factors are thus detected.
Here, a logical sum of interrupt signals from some sensors is obtained and supplied to the CPU in order to reduce the number of pins to be input to the CPU in the main control unit. For this reason, it cannot be determined based on the signal of this logical sum which event the returning factor is. For example, assume a case where a signal of a logical sum of a signal indicating paper detection at the manual bypass tray and signals of other sensors is supplied to the CPU. At this time, for example, if paper placed in the manual bypass tray is replaced when in a power-saving state and thereafter the apparatus returns from the power-saving state due to a factor other than paper detection at the manual bypass tray, the setting/registration screen for manually inserted paper is not displayed.
Japanese Patent Laid-Open No. 2011-193113 discloses a technique of measuring the time at which a feed cassette is opened and closed when in a sleep state, determining that paper has been changed if it is detected that the feed cassette is opened a certain time period or longer, and storing information thereof.
Here, assume a case where paper is set in the manual bypass tray before the apparatus transitions to the power-saving state, and the apparatus returns from the power-saving state as a result of the user replacing paper in the manual bypass tray with a different kind of paper while in the power-saving state. In this case, since a signal of a logical sum of a signal indicating paper detection at the manual bypass tray and signals from other sensors is supplied to the CPU, the CPU cannot recognize the cause of the returning from the power-saving state. In such a case, the setting/registration screen for the paper set in the manual bypass tray is not displayed when the apparatus returns from the power-saving state. For this reason, manual bypass tray paper information is not updated to information regarding the newly-set paper, and therefore paper of a type which is different from the type provided in print conditions set by a print job may possibly be fed from the manual bypass tray and printed. In this case, a problem arises in that the quality of an image printed on this paper is degraded, resulting in wasteful use of paper.